<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<title>验证后台</title>
<link rel="stylesheet" href="__HOME__/css/public_style.css">
<style>
	body{background:url(__HOME__/img/yanzheng_bg.jpg) no-repeat fixed;background-size:cover;}
	::-webkit-input-placeholder {color:#fff;} /* WebKit, Blink, Edge */
	:-moz-placeholder {color:#fff;} /* Mozilla Firefox 4 to 18 */
	::-moz-placeholder {color:#fff;} /* Mozilla Firefox 19+ */
	:-ms-input-placeholder {color:#fff;} /* Internet Explorer 10-11 */
	
	.shuru_kuang{position:fixed;width:280px;height:210px;top:calc(50% - 105px);left:calc(50% - 140px);}
	.shuru_kuang>ul{width:100%;height:100%;}
	.shuru_kuang>ul>li{height:40px;line-height:40px;}
	.shuru_kuang>ul>li:nth-of-type(1){margin-bottom:30px;}
	
	.shuru_kuang>ul>li:nth-of-type(3){margin-top:60px;}
	.shuru_kuang>ul>li>input{
		display:block;border:none;border-radius:20px;background-color:rgba(229,245,249,.45);
		width:100%;height:100%;text-indent:30px;color:#666;outline:none;transition:.2s;
	}
	.shuru_kuang>ul>li>input:hover{background-color:rgba(229,245,249,1);}
	.shuru_kuang>ul>li>button{
		display:block;border:none;border-radius:20px;background-color:#dedfee;width:100%;height:100%;color:#4a4a4a;outline:none;transition:.2s;
	}
	.quren{background-color:#5a51a0!important;color:#fff!important;box-shadow:0 0 10px 0 rgba(255,255,255,.6);}
	
</style>
</head>

<body>
	<form name="login" method="post" class="shuru_kuang" onsubmit="return sb1()" action="javascript:;">
		<ul>
			<li><input name="username" id="username" type="text" placeholder="输入账号"></li>
			<li><input name="password" id="passsword" type="password" placeholder="请输入密码"></li>
			<li><button>确定</button></li>
		</ul>
	</form>
</body>
<script src="__HOME__/js/jquery-3.3.1.js"></script>
<script src="__HOME__/js/layer.js"></script>
<script>
	function sb1(){

        var username = document.login.username.value;
        var password = document.login.password.value;

        if(trim(username)==null || trim(username)==""){
            alert("请输入账号");
            username.focus();
            return false;
        }
        if(trim(password)==null || trim(password)==""){
            alert("请输入密码");
            password.focus();
            return false;
        }

        $.post('/index/check/login',{'uname':username,'pwd':password},function(msg){

        	if(msg){
        		window.location.href="/index/check/show.html";
        		return false;
        	}else{

        		layer.open({ content: '账号或密码错误' ,skin: 'msg' ,time: 2});
        		return false;
        	}
        });

        return false;
    }
    function trim(str){ //删除左右两端的空格
    　　     return str.replace(/(^\s*)|(\s*$)/g, "");
    }

</script>
</html>
